
import { IncomingHttpHeaders } from 'http';
import { systemid,productid } from '../../atom/config';
import query from '@dfeidao/atom-nodejs/db/query';
import count from '@dfeidao/atom-nodejs/db/count';

interface Message {
	filter:{
		meeting_nos:string[],
		pn:number
	}
	// cookie: {
	// 	uk: string;
	// 	[key: string]: string
	// };
	// urls: {
	// 	base: string;
	// 	origin: string;
	// 	url: string;
	// };
	// query: {};
	// params: {};
	// headers: {};
	// captcha: string;
}
export default async function atom(message: Message, action_id: string, session_id: string, headers: IncomingHttpHeaders) {
	const p=query(action_id,session_id,systemid);
	p.prepare('meeting_administration',['meeting_no','meeting_name','start_time','conference_theme','meeting_status',
	'sponsor','meeting_address'],{productid,meeting_no:{$in:message.filter.meeting_nos}},20,message.filter.pn,['start_time'],['2']);
	//1是升序 2是降序
	const [dt]=await p.exec();
	const t=count(action_id,session_id,systemid);
	t.prepare('meeting_administration',{productid,meeting_no:{$in:message.filter.meeting_nos}});
	const c=await t.exec()
	return {dt,c};
	

}
